- spriteBatch.Draw(Texture, Position, null, Color.White, Angle, Origin, 1f, SpriteEffects.None, 0f);
+ Actor child = null;
+
+ // TODO: Check what's up with the null children.
+ if (Children == null)
+ {
+ return;
+ }
+ for (var i = Children.Count - 1; i >= 0; i--)
+ {
+ child = Children[i];
+ child.Draw(spriteBatch);
+ }
+
+ spriteBatch.Draw(Texture, Position, null, Color, Angle, Origin, 1f, SpriteEffects.None, 0f);
+ //spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
+ }
+
+ void CheckOutliers()
+ {
+ for (var i = Children.Count; i > 0; i--)
+ {
+ var actor = Children[i - 1];
+ if (actor.Position.X < -SuperPolarity.OutlierBounds || actor.Position.Y < -SuperPolarity.OutlierBounds ||
+ actor.Position.X > game.GraphicsDevice.Viewport.Width + SuperPolarity.OutlierBounds ||
+ actor.Position.Y > game.GraphicsDevice.Viewport.Height + SuperPolarity.OutlierBounds)
+ {
+ Children.Remove(actor);
+ }
+ }
+ }
+
+ public virtual void Collide(Actor other, Rectangle collision)
+ {
+ }
+
+ public void TakeDamage(int amount)
+ {
+ if (!Immortal)
+ {
+ HP = HP - amount;
+ if (HP < 0)
+ {
+ Die();
+ }
+ }
+ }
+
+ protected virtual void Die()
+ {
+ Dying = true;
+ }
+
+ public virtual void CleanUp()
+ {
+ Texture = null;
+ BoxTexture = null;
+ Children = null;
+ Texture = null;